﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FieldDevice.Devices
{
    class DevicePM5350:Device
    {
        public DevicePM5350(byte address, string name)
            : base(DeviceCategory.PowerMeter, address, name)
        {
            Initialize();
        }

        private const ushort Register_Ia = 3000;                //A相电流的寄存器地址
        private const ushort Register_Ib = 3002;                //B相电流的寄存器地址
        private const ushort Register_Ic = 3004;                //C相电流的寄存器地址
        private const ushort Regeister_Vab = 3020;              //AB线电压的寄存器地址
        private const ushort Register_Vbc = 3022;               //BC线电压的寄存器地址
        private const ushort Register_Vca = 3024;               //CA线电压的寄存器地址
        private const ushort Register_Va = 3028;                //A相电压的寄存器地址
        private const ushort Register_Vb = 3030;                //B相电压的寄存器地址
        private const ushort Register_Vc = 3032;                //C相电压的寄存器地址
        private const ushort Register_P=3060;                    //有功功率的寄存器地址
        private const ushort Register_Q = 3068;                 //无功功率的寄存器地址
        private const ushort Register_S = 3076;                 //视在功率的寄存器地址
        private const ushort Regsiter_Factor = 3084;               //功率因数的寄存器地址
        private const ushort Register_Kw = 3204;                   //吸收有功电能的寄存器地址
        private const ushort Register_Kvar = 3224;                  //无功电能（吸收）



        void Initialize()
        {
            base.RequestRegister(Register_Ia, 36);
            base.RequestRegister(Register_P, 30);
            base.RequestRegister(Register_Kw, 20);   
        }
        protected override float Translate(byte[] value, int begin, ushort registeraddress)
        {
            return 0.0f;
        }

    }
}
